<a href='https://github.com/angular/angular.js/edit/v1.3.x/src/ng/filter/filters.js?message=docs(currency)%3A%20describe%20your%20change...#L3' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this Doc</a>



<a href='https://github.com/angular/angular.js/tree/v1.3.13/src/ng/filter/filters.js#L3' class='view-source pull-right btn btn-primary'>
  <i class="glyphicon glyphicon-zoom-in">&nbsp;</i>View Source
</a>


<header class="api-profile-header">
  <h1 class="api-profile-header-heading">currency</h1>
  <ol class="api-profile-header-structure naked-list step-list">
    
    <li>
      - filter in module <a href="api/ng">ng</a>
    </li>
  </ol>
</header>



<div class="api-profile-description">
  <p>Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default
symbol for current locale is used.</p>

</div>




<div>
  

  
  <h2>Usage</h2>
  <h3>In HTML Template Binding</h3>
  
    <pre><code>{{ currency_expression | currency : symbol : fractionSize}}</code></pre>
  

  <h3>In JavaScript</h3>
  <pre><code>$filter(&#39;currency&#39;)(amount, symbol, fractionSize)</code></pre>

  
<section class="api-section">
  <h3>Arguments</h3>

<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        amount
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-number">number</a>
      </td>
      <td>
        <p>Input to filter.</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        symbol
        
        <div><em>(optional)</em></div>
      </td>
      <td>
        <a href="" class="label type-hint type-hint-string">string</a>
      </td>
      <td>
        <p>Currency symbol or identifier to be displayed.</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        fractionSize
        
        <div><em>(optional)</em></div>
      </td>
      <td>
        <a href="" class="label type-hint type-hint-number">number</a>
      </td>
      <td>
        <p>Number of decimal places to round the amount to, defaults to default max fraction size for current locale</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

</section>
  
  <h3>Returns</h3>
<table class="variables-matrix return-arguments">
  <tr>
    <td><a href="" class="label type-hint type-hint-string">string</a></td>
    <td><p>Formatted number.</p>
</td>
  </tr>
</table>


  
  <h2 id="example">Example</h2><p>

<div>
  <a ng-click="openPlunkr('examples/example-example98', $event)" class="btn pull-right">
    <i class="glyphicon glyphicon-edit">&nbsp;</i>
    Edit in Plunker</a>

  <div class="runnable-example"
      path="examples/example-example98"
      module="currencyExample">

  
    <div class="runnable-example-file" 
      name="index.html"
      language="html"
      type="html">
      <pre><code>&lt;script&gt;&#10;  angular.module(&#39;currencyExample&#39;, [])&#10;    .controller(&#39;ExampleController&#39;, [&#39;$scope&#39;, function($scope) {&#10;      $scope.amount = 1234.56;&#10;    }]);&#10;&lt;/script&gt;&#10;&lt;div ng-controller=&quot;ExampleController&quot;&gt;&#10;  &lt;input type=&quot;number&quot; ng-model=&quot;amount&quot;&gt; &lt;br&gt;&#10;  default currency symbol ($): &lt;span id=&quot;currency-default&quot;&gt;{{amount | currency}}&lt;/span&gt;&lt;br&gt;&#10;  custom currency identifier (USD$): &lt;span id=&quot;currency-custom&quot;&gt;{{amount | currency:&quot;USD$&quot;}}&lt;/span&gt;&#10;  no fractions (0): &lt;span id=&quot;currency-no-fractions&quot;&gt;{{amount | currency:&quot;USD$&quot;:0}}&lt;/span&gt;&#10;&lt;/div&gt;</code></pre>
    </div>
  
    <div class="runnable-example-file" 
      name="protractor.js"
      type="protractor"
      language="js">
      <pre><code>it(&#39;should init with 1234.56&#39;, function() {&#10;  expect(element(by.id(&#39;currency-default&#39;)).getText()).toBe(&#39;$1,234.56&#39;);&#10;  expect(element(by.id(&#39;currency-custom&#39;)).getText()).toBe(&#39;USD$1,234.56&#39;);&#10;  expect(element(by.id(&#39;currency-no-fractions&#39;)).getText()).toBe(&#39;USD$1,235&#39;);&#10;});&#10;it(&#39;should update&#39;, function() {&#10;  if (browser.params.browser == &#39;safari&#39;) {&#10;    // Safari does not understand the minus key. See&#10;    // https://github.com/angular/protractor/issues/481&#10;    return;&#10;  }&#10;  element(by.model(&#39;amount&#39;)).clear();&#10;  element(by.model(&#39;amount&#39;)).sendKeys(&#39;-1234&#39;);&#10;  expect(element(by.id(&#39;currency-default&#39;)).getText()).toBe(&#39;($1,234.00)&#39;);&#10;  expect(element(by.id(&#39;currency-custom&#39;)).getText()).toBe(&#39;(USD$1,234.00)&#39;);&#10;  expect(element(by.id(&#39;currency-no-fractions&#39;)).getText()).toBe(&#39;(USD$1,234)&#39;);&#10;});</code></pre>
    </div>
  

    <iframe class="runnable-example-frame" src="examples/example-example98/index.html" name="example-example98"></iframe>
  </div>
</div>


</p>

</div>


